/*
 * ﻿Copyright (C) 2009-2013 NewMain Softech
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 */
package com.newmainsoftech.gwetons.client.logging;

import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.core.client.JsArrayMixed;
import com.google.gwt.core.client.JsArrayString;
import com.newmainsoftech.gwetons.shared.logging.LoggerWrap;

/**
 * Interface defining, for usage in JSNI method of GWT client side class, accessor methods to logger. <br />
 * {@link JsniLoggerWrapImpl} class is the out-of-box implementation of this interface.
 * 
 * @author <a href="mailto:artymt@gmail.com">Arata Y.</a>
 */
public interface JsniLoggerWrap {
	LoggerWrap getLoggerWrap();
	void setLoggerWrap( LoggerWrap loggerWrap);

	JavaScriptObject getLogFunction();
	
	void entering( String sourceMethod, JsArrayMixed params);
	JavaScriptObject getEnteringFunction();
	
	JavaScriptObject getExitingFunction();	
	JavaScriptObject getExitingWithResultFunction();
	
	/**
	 * Deprecated; use {@link #entering(String, JsArrayMixed)} method or utilize javascript function 
	 * object returned by {@link #getEnteringFunction()} instead. 
	 * 
	 * @param jsArrayString consists of information of entering method. <br />
	 * Elements of this are expected in the following order:
	 * <ul>
	 * <li>String: name of method</li>
	 * <li>String: additional message such as method arguments</li>
	 * <li>String representation of boolean to specify whether ignore the previous String element of  
	 * the additional message</li>
	 * <li>String representation of Logger.Level</li>
	 * </ul>
	 */
	@Deprecated
	void logEntering( JsArrayString jsArrayString);
	/**
	 * Deprecated; instead, utilize javacript function object returned by either 
	 * {@link #getExitingFunction()} method or {@link #getExitingWithResultFunction()} method.  
	 * 
	 * @param jsArrayString consists of information of exiting method. <br />
	 * Elements of this are expected in the following order:
	 * <ul>
	 * <li>String: name of method</li>
	 * <li>String representation of returned object</li>
	 * <li>String representation of boolean to specify whether ignore the previous String element for 
	 * the returned object for the returning void case</li>
	 * <li>String representation of Logger.Level</li>
	 * </ul>
	 */
	@Deprecated
	void logExiting( JsArrayString jsArrayString);
}
